package com.woniuxy.controller;

import com.woniuxy.entity.CheckProjectManage;
import com.woniuxy.entity.DeviceManage;
import com.woniuxy.service.CheckProjectManageService;
import com.woniuxy.service.DeviceManageService;
import com.woniuxy.util.PageParam;
import com.woniuxy.util.ResponseData;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/checkProject")
public class CheckProjectManageController {
    @Resource
    private CheckProjectManageService checkProjectManageService;

    @PostMapping("/queryCheckProject")
    public ResponseData<?> queryCheckProject(@RequestBody PageParam<CheckProjectManage> pageParam){
        Assert.notNull(pageParam,"pageParam is not null");
        return checkProjectManageService.queryCheckProject(pageParam);
    }


    @PostMapping("/addCheckProject")
    public ResponseData<?> addCheckProject(@RequestBody CheckProjectManage checkProjectManage){
        Assert.notNull(checkProjectManage,"checkProjectManage is not null");
        return checkProjectManageService.addCheckProject(checkProjectManage);
    }


    @GetMapping("/queryCheckProjectById/{id}")
    public ResponseData<?> queryCheckProjectById(@PathVariable("id")Integer id){
        Assert.notNull(id,"id is not null");
        return checkProjectManageService.queryCheckProjectById(id);
    }


    @PostMapping("/updateCheckProject")
    public ResponseData<?> updateCheckProject(@RequestBody CheckProjectManage checkProjectManage){
        Assert.notNull(checkProjectManage,"checkProjectManage is not null");
        return checkProjectManageService.updateCheckProject(checkProjectManage);
    }

    @GetMapping("/deleteCheckProject/{id}")
    public ResponseData<?> deleteCheckProject(@PathVariable("id")Integer id){
        Assert.notNull(id,"id is not null");
        return checkProjectManageService.deleteCheckProject(id);
    }
}
